let mysql =require("mysql");
let connection = mysql.createConnection({
    host : 'localhost',
    user : 'root',
    password : 'root',
    database : 'stum'
});

connection.connect();

connection.query("insert into stum values(1,'张三','男','123121515',412,'231')",function(err,result,fields){
    if(err) throw err;
    console.log("结果为"+result);
    console.log(fields);
})

connection.query("SELECT * FROM stuM",function(err,result,fields){
    if(err) throw err;
    console.log("结果为"+result);
    console.log(fields);
})